/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

const saleRouter = {
  path: '/sale',
  component: Layout,
  name: 'Sale',
  redirect: '/business/index',
  meta: {
    title: '销售管理',
    icon: 'shopping',
    roles:['管理员','销售员']
  },
  children: [
    {
      path: 'index',
      // component: () => import('@/views/sale/index'),
      component: (resolve) => require(['@/views/sale/index'], resolve),
      name: 'saleIndex',
      meta: { title: '销售单' , roles:['管理员','销售员']}
    },
    {
      path: 'return',
      component: (resolve) => require(['@/views/sale/returned'], resolve),
      // component: () => import('@/views/sale/returned'),
      name: 'return',
      meta: { title: '退货记录' , roles:['管理员','销售员']}
    },
    {
      path: 'payment',
      component: (resolve) => require(['@/views/sale/payment'], resolve),
      // component: () => import('@/views/sale/payment'),
      name: 'payment',
      meta: { title: '付款记录' , roles:['管理员','销售员']}
    },
    {
        path: 'saleStatistics',
        component: (resolve) => require(['@/views/sale/saleStatistics'], resolve),
        // component: () => import('@/views/sale/saleStatistics'),
        name: 'saleStatistics',
        meta: { title: '销售统计' , roles:['管理员', '销售员']}
    },
  ]
}
export default saleRouter
